<?php
/**
 * Notes:
 * Created by PhpStorm.
 * Author: TS
 * Date: 2019/10/27
 * Time: 11:41
 */

namespace app\model;


use think\Model;

class Auth extends Model
{
    public function getAllAuth(){
        return self::select();
    }
    public function getByRole($role_id){
        return self::where(['role_id' => $role_id])->select();
    }
    public function getByRule($rule_id){
        return self::where(['rule_id' => $rule_id])->select();
    }
    public function add($data){
        return self::create($data);
    }
    public function check($role_id,$rule_id){
        return self::get([
            'role_id' => $role_id,
            'rule_id' => $rule_id
        ]);
    }

    public function getById($auth_id){
        return self::get($auth_id);
    }

    public function del($auth_id){

    }

}